 define(function () {
   /**
    * 根据属性获取url路径中的query参数
    * @param {string} name 属性名
    */
   var getUrlParam = function (name) {
     let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
     let r = window.location.search.substr(1).match(reg);
     if (r != null) return decodeURIComponent(r[2]);
     return null;
   };
   /**
    * url添加参数
    * @param {string} url 
    * @param {string} name 
    * @param {string} value 
    */
   var addURLParam = function (url, name, value) {
     url += (url.indexOf('?') == -1 ? '?' : '&');
     if (name != null && value != null) {
       url += encodeURIComponent(name) + '=' + encodeURIComponent(value);
     }
     return url;
   };
   return {
     getUrlParam: getUrlParam,
     addURLParam: addURLParam,
   }

 });